<?php
namespace Plugin\Attractions\AttractionManagement\Schema\Attraction_spot_position;

use Plugin\Attractions\AttractionManagement\Model\Attraction_spot_position\AttractionSpotPosition;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 景点位置
 */
#[Schema(title: 'AttractionSpotPositionSchema')]
class AttractionSpotPositionSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'name', title: '位置名称', type: 'varchar')]
    public string $name;

    #[Property(property: 'longitude', title: '中心经度', type: 'decimal')]
    public string $longitude;

    #[Property(property: 'latitude', title: '中心纬度', type: 'decimal')]
    public string $latitude;

    #[Property(property: 'altitude', title: '中心海拔', type: 'decimal')]
    public string $altitude;

    #[Property(property: 'created_at', title: 'created_at', type: 'datetime')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'datetime')]
    public string $updated_at;




    public function __construct(AttractionSpotPosition $model)
    {
       $this->id = $model->id;
       $this->name = $model->name;
       $this->longitude = $model->longitude;
       $this->latitude = $model->latitude;
       $this->altitude = $model->altitude;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'name' => $this->name ,'longitude' => $this->longitude ,'latitude' => $this->latitude ,'altitude' => $this->altitude ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at];
    }
}